package org.acooke.uykfd.cmd

import java.sql.Connection

import jline.ConsoleReader

object Reader {
  
  def apply(cnxn: Connection) {
    val console = new jline.ConsoleReader()
    println("uykfd (c) 2009 andrew@acooke.org")
    println("GPLv3 - no warranty - contains other libs")
    println("'quit' or 'exit' or Ctrl-D to quit\n")
    while (true) {
      var line = console.readLine("> ")
      if (line == null) line = "exit"
      Dispatcher(line, cnxn)
    }
  }

}

